package com.zy.leaderSide.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.leaderSide.entity.Leader;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @author CR
 */
@Mapper
@Component
public interface LeaderDao extends BaseMapper<Leader> {


    /**
     * 根据领导的编号和密码进行查询
     * @param leaderNum
     * @param leaderPassword
     * @return Leader
     */
    @Select("select * from hms_leader where leader_num=#{leaderNum} and leader_password=#{leaderPassword}")
    Leader leaderLogin(Integer leaderNum,String leaderPassword);

    /**
     * 根据领导编号进行查重
     * @param leaderNum
     * @return Leader
     */
    @Select("select * from hms_leader where leader_num=#{leaderNum}")
    Leader getLeaderById(Integer leaderNum);
}
